<template>
  <div class="w-full pb-80px text-14px" v-if="Info.data.length > 0">
    <div class="p-20px bg-white border-b" v-for="item in Info.data">
      <div class="flex w-full justify-between items-center">
        <div>直推业绩奖励</div>
        <div class="text-[#0CB031]">+15.04</div>
      </div>
      <div class="mt-15px flex w-full justify-between items-center">
        <div>2023-10-08 11:26:28</div>
        <div>余额：46.69</div>
      </div>
    </div>
  </div>
  <div v-else class="mt-200px">
    <nodata></nodata>
  </div>
  <pagination
    @back="back"
    @next="next"
    :current_page="Info.current_page"
    :last_page="Info.last_page"
    :per_page="Info.per_page"
    :total="Info.total"
  ></pagination>
</template>
<script setup>
import pagination from "@/components/pagination.vue";
import nodata from "@/components/nodata.vue";
import { finance } from "@/util/api";
const Info = reactive({
  current_page: 0,
  last_page: 0,
  per_page: 0,
  total: 0,
  data: [],
});
const param = reactive({
  page: 1,
  type: 1, //奖金明细
});
const getDate = async () => {
  const res = await finance(param);
  Info.current_page = res.msg.current_page;
  Info.last_page = res.msg.last_page;
  Info.per_page = res.msg.per_page;
  Info.total = res.msg.total;
  Info.data = res.msg.data;
};
getDate();
const back = () => {
  param.value--;
  getDate();
};
const next = () => {
  param.value++;
  getDate();
};
</script>
